package jtk.project4.fleet.field;

import java.awt.Dimension;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.TextField;

public class NewEquipmentGeneralPmTrackingField extends GroupControl{
	private TextField currMillageField;
	private TextField baseMillageField;
	private CalendarControl baseDate;
	private ComboField maintSchedField;
	
	
	public NewEquipmentGeneralPmTrackingField(String bindID){
		setTitle("header.PM Tracking");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		currMillageField = new TextField ("unit", 20);
		currMillageField.setRequired(true);
		
		baseMillageField = new TextField ("year", 20);
		baseMillageField.setRequired(true);
		
		maintSchedField = new ComboField("equipments","make");
		maintSchedField.setPreferredSize(new Dimension(100, 20));
		
		baseDate = new CalendarControl("Date", 20);
		baseDate.setPreferredSize(new Dimension(100, 20));
	}
	
	private void createLayout() {
		setLayout(new FormLayout())
		.addLabel("Maint Sched:")		.addField(maintSchedField)
		.addRow()
		.addLabel("Curr Millage:").addField(currMillageField)
		.addRow()
		.addLabel("Base Millage:").addField(baseMillageField)
		.addRow()
		.addLabel("Base Date:").addField(baseDate);
	}
}
